/**
 * @author		Sergey Suzdalskiy
 * @e-mail:		sergey.suzdalskiy@gmail.com
 */
package ua.kiev.gcore.ui.controls
{	
	import flash.display.DisplayObject;
	
	public class HBox extends Box
	{
		
		public function HBox()
		{
			super();
		}
		
		override protected function resize():void{
			super.resize();
			var dWidgth:Number = 0;
			for(var i:int = 0; i < numChildren; i++){
				var displayObject:DisplayObject = getChildAt(i);
				displayObject.x = dWidgth;
				
				displayObject.y = this.height/2 - displayObject.height/2;
				
				dWidgth += (getChildAt(i).width + spacing);
			}
		}
	}
}